#ifndef _CLIENTSENDER_H_
#define _CLIENTSENDER_H_

#pragma once
#include "GameClient.h"
#include "concurrent\Runnable.h"

using namespace concurrent;

class GameClient;

/*
 * In order to send data concurrently the GamePlayerClient class must be wrapped around this class which
 * starts a new thread through the Runnable interface.
 */
class ClientSender : public Runnable
{
public:
	ClientSender(GameClient*);
	virtual ~ClientSender(void);
	
	void setClient(GameClient* client);
	GameClient* getClient(void);
	void setIsSending(bool flag);
	bool isSending(void);

	int startSendingUpdates(void);
	void stopSendingUpdates(void);

protected:
	virtual DWORD run(void);
private:
	GameClient* client;
	bool _isSending;
};

#endif
